import request from "@/utils/request";
const Base = process.env.VUE_APP_BASE_API;
// vpn新增
export function vpnAdd(data) {
  return request({
    url: `${Base}/vpnInfo/add`,
    method: "post",
    data,
  });
}
//分页
export function vpnPage(query) {
  return request({
    url: `${Base}/vpnInfo/page/`,
    method: "get",
    params: query,
  });
}
//删除
export function vpnDel(ids) {
  return request({
    url: `${Base}/vpnInfo/remove/${ids}`,
    method: "delete",
  });
}
//修改
export function vpnEdit(data) {
  return request({
    url: `${Base}/vpnInfo/update`,
    method: "post",
    data,
  });
}
//详情
export function vpnDetail(id) {
  return request({
    url: `${Base}/vpnInfo/getInfo/${id}`,
    method: "get",
  });
}
//不分页列表
export function vpnList(query) {
  return request({
    url: `${Base}/vpnInfo/list`,
    method: "get",
    params: query,
  });
}

//vpn账号分页
export function vpnAccountPage(query) {
  return request({
    url: `${Base}/account/page`,
    method: "get",
    params: query,
  });
}

//vpn账号新增
export function vpnAccountList(data) {
  return request({
    url: `${Base}/account/add`,
    method: "post",
    data,
  });
}

//vpn账号授权
export function vpnAccountauthorize(data) {
  return request({
    url: `${Base}/account/authorize`,
    method: "post",
    data,
  });
}
//vpn账号删除
export function vpnAccountdel(ids) {
  return request({
    url: `${Base}/account/remove/${ids}`,
    method: "delete",
  });
}

//id列表
export function getIdList() {
  return request({
    url: `${Base}/vpnInfo/vpnIdList`,
    method: "get",
  });
}

//VPN服务管理详情
export function vpnAccDetail(id) {
  return request({
    url: `${Base}/account/getInfo/${id}`,
    method: "get",
  });
}
//VPN服务管理修改
export function vpnAccUpdate(data) {
  return request({
    url: `${Base}/account/update/`,
    method: "post",
    data
  });
}